<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <!-- <ul>
            <li>
                <h1>凉菜</h1>
                <ol>
                    <li>凉拌黄瓜</li>
                    <li>油炸花生米</li>
                </ol>
            </li>
            <li>
                <h1>小炒</h1>
                <ol>
                    <li>青椒土豆丝</li>
                    <li>红烧肉</li>
                </ol>
            </li>
            <li>
                <h1>汤类</h1>
                <ol>
                    <li>酸辣肚丝汤</li>
                    <li>醪糟圆子</li>
                </ol>
            </li>
        </ul> -->
        <!-- <ul>
            <li v-for="item in fenLei">
                <h1>{{item}}</h1>
                <ol v-for="item1 in caiPing">
                    <li>{{item1[1]}}</li>
                    <li></li>
                </ol>
            </li>
        </ul> -->
        <ul>
            <!-- 循环一级数组 -->
            <li v-for="cate in menuList">
                <h1>{{cate.cateName}}</h1>
                <ol>
                    <li v-for="item in cate.list">{{item.name}}</li>
                </ol>
            </li>
        </ul>
    </div>
</body>

</html>
<script src="js/vue3.4.21.js"></script>
<script>
    const {
        createApp,
        ref
    } = Vue

    createApp({
        setup() {
            const fenLei = ref(['凉菜', '小炒', '汤类'])
            const caiPing = ref(['凉拌黄瓜', '油炸花生米'], ['青椒土豆丝', '红烧肉'], ["酸辣肚丝汤", '醪糟圆子'])
            const menuList = ref([{
                cateName: '凉菜',
                list: [{
                    id: 1,
                    name: '小炒肉'
                }, {
                    id: 2,
                    name: '青椒土豆丝'
                }]
            }, {
                cateName: '小炒',
                list: [{
                    id: 1,
                    name: '小炒肉'
                }, {
                    id: 2,
                    name: '青椒土豆丝'
                }]
            }, {
                cateName: '小炒',
                list: [{
                    id: 1,
                    name: '小炒肉'
                }, {
                    id: 2,
                    name: '青椒土豆丝'
                }]
            }])

            return {
                fenLei,
                caiPing,
                menuList
            }
        }



    }).mount('#app')
</script>